﻿import request from '/@/utils/request';
enum Api {
  AddBusProduct = '/api/busProduct/add',
  DeleteBusProduct = '/api/busProduct/delete',
  UpdateBusProduct = '/api/busProduct/update',
  PageBusProduct = '/api/busProduct/page',
  GetBusAttributeDropdown = '/api/busProduct/BusAttributeDropdown',
  GetBusCategoryDropdown = '/api/busProduct/BusCategoryDropdown',
  GetProductCateList = '/api/busProduct/GetProductCateList',
  GetProductAttriList = '/api/busProduct/GetProductAttriList',
  GetProductAttriValueList= '/api/busProduct/GetProductAttriValueList',
}

// 增加物料管理
export const addBusProduct = (params?: any) =>
	request({
		url: Api.AddBusProduct,
		method: 'post',
		data: params,
	});

// 删除物料管理
export const deleteBusProduct = (params?: any) => 
	request({
			url: Api.DeleteBusProduct,
			method: 'post',
			data: params,
		});

// 编辑物料管理
export const updateBusProduct = (params?: any) => 
	request({
			url: Api.UpdateBusProduct,
			method: 'post',
			data: params,
		});

// 分页查询物料管理
export const pageBusProduct = (params?: any) => 
	request({
			url: Api.PageBusProduct,
			method: 'post',
			data: params,
		});

export const getBusAttributeDropdown = () =>
		request({
		url: Api.GetBusAttributeDropdown,
		method: 'get'
		});
export const getBusCategoryDropdown = () =>
		request({
		url: Api.GetBusCategoryDropdown,
		method: 'get'
		});
export const getProductCateList = (param?: any) =>
		request({
			url: Api.GetProductCateList,
			method: 'get',
			data: param
		});
export const getProductAttriList = (param?: any) =>
		request({
			url: Api.GetProductAttriList,
			method: 'get',
			data: param
		});	
export const getProductAttriValueList = (param?: any) =>
		request({
			url: Api.GetProductAttriValueList,
			method: 'get',
			data: param
		});				

